<div id="manajemen-peternakan">
	<div id="menambah-peternakan" class="row-fluid sortable ui-sortable">
		<form id="form_peternakan" method="post" action="<?php echo base_url();?>peternakan/tambah_peternakan">
			<div class="box span12">
				<div class="box-header well" data-original-title>
					<h2>Menambahkan Data Peternakan</h2>
					<div class="box-icon">
						<a href="#" class="btn btn-setting btn-round"><i class="icon-cog"></i></a>
						<a href="#" class="btn btn-minimize btn-round"><i class="icon-chevron-up"></i></a>
					</div>
				</div>
				<div class="box-content">
					<table class="table">
						<tbody>
							<tr>
								<td><label class="control-label">Kota</label></td>
								<td>
									<div class="controls">
									  <select data-rel="chosen" name='kota'>
										<?php
											foreach($kota as $row){
												echo "<option value='".$row["ID_KOTA"]."'>".$row["NAMA_KOTA"]."</option>";
											}
										?>
									  </select>
									</div>
								</td>
							</tr>
							<tr>
								<td><label class="control-label">Nama</label></td>
								<td><input id="nama" type="text" name="nama"></input></td>
							</tr>
							<tr>
								<td><label class="control-label">Alamat</label></td>
								<td><input type="text" name="alamat"></input></td>
							</tr>
							<tr>
								<td><label class="control-label">Telepon</label></td>
								<td><input type="text" name="telepon"></input></td>
							</tr>
							<tr>
								<td><label class="control-label">Email</label></td>
								<td><input type="text" name="email"></input></td>
							</tr>
							<tr>
								<td><label class="control-label">Kode Pos</label></td>
								<td><input type="text" name="kode-pos"></input></td>
							</tr>
							<tr>
								<td><label class="control-label">Tanggal Berdiri</label></td>
								<td><input type="text" name="tgl-berdiri" class="input-xmedium datepicker"></input></td>
							</tr>
							<tr>
								<td><label class="control-label">Info</label></td>
								<td><input type="text" name="info"></input></td>
							</tr>
							<tr>
								<td><label class="control-label">Lat</label></td>
								<td><input type="text" name="lat"></input></td>
							</tr>
							<tr>
								<td><label class="control-label">Lon</label></td>
								<td><input type="text" name="lon"></input></td>
							</tr>
							<tr>
								<td><label class="control-label">Jumlah Sapi</label></td>
								<td><input type="text" name="jumlah"></input></td>
							</tr>
							<tr>
								<td></td>
								<td><input type="submit" class="btn"></input></td>
							</tr>
						</tbody>
					</table>
				</div>
			</div>
		</form>
	</div>
	<div id="data-peternakan">
		<div class="box">
			<div class="box-header well" data-original-title>
				<h2>Data Peternakan</h2>
				<div class="box-icon">
					<a href="#" class="btn btn-setting btn-round"><i class="icon-cog"></i></a>
					<a href="#" class="btn btn-minimize btn-round"><i class="icon-chevron-up"></i></a>
				</div>
			</div>
			<div class="box-content">
				<table class="table table-striped table-bordered bootstrap-datatable datatable">
					<thead>
						<tr>
							<th>Nama</th>
							<th>Kota</th>
							<th>Alamat</th>
							<th>Kode Pos</th>
							<th>Telepon</th>
							<th>Email</th>
							<th>Tanggal Berdiri</th>
							<th>Jumlah Sapi</th>
							<th>Info</th>
							<th style="border-right:none;"></th>
						</tr>
					</thead> 
					<tbody>
					<?php
						foreach($peternakan as $row){
							echo"
								<tr>
									<td id='peter-nama'>".$row["NAMA"]."</td>
									<td id='peter-nama-kota'>".$row["NAMA_KOTA"]."</td>
									<td id='peter-alamat'>".$row["ALAMAT"]."</td>
									<td id='peter-pos'>".$row["KODE_POS"]."</td>
									<td id='peter-telp'>".$row["NO_TELP"]."</td>
									<td id='peter-email'>".$row["EMAIL"]."</td>
									<td id='peter-tgl'>".$row["TANGGAL_BERDIRI"]."</td>
									<td id='peter-jumlah'>".$row["JUMLAH_SAPI"]."</td>
									<td id='peter-info'>".$row["INFO"]."</td>
									<td style='border-right:none;'>
										<i class='icon-edit edit-peter' id='".$row['ID_TITIK_PASOK']."'></i>
										<i class='icon-remove-sign delete-peter' id='".$row['ID_TITIK_PASOK']."'></i>
									</td>
								</tr>
							";
						}
					?>
					</tbody>
				</table>
			</div>
		</div>
	</div>
</div>
<script>
	//var peternakan = <?php foreach($peternakan as $row){echo json_encode($peternakan);}?>;
</script>